import { SysAuth } from "@/api-services/models/system";
import { BaseApi } from "@/api-services/apis/baseApi";

/**
 * 认证服务
 */
class SysAuthApi extends BaseApi {
  //登录
  login = async (data: SysAuth.LoginInput) => {
    return this.normalPost<SysAuth.LoginInfo>(`/login`, data);
  };

  //退出
  loginOut = async () => {
    return this.normalGet(`/loginOut`, null);
  };

  //获取验证码
  getCaptcha = async () => {
    return this.normalGet<object>(`/getCaptcha`, null);
  };
  //获取登录时配置
  getConfig = async () => {
    return this.normalGet<object>(`/getConfig`, null);
  };
}

export default new SysAuthApi("/system/auth");
